Starting a Remote Debugging Session

After the WinDbg components are in their locations and properly configured, you can begin a remote debugging session.

{bmc bm4.MRB}        To start a remote debugging session

  1.  If you are debugging across a serial cable, connect the cable to both the target and host.

  2.  On the target computer:

    Install your program and its DLLs. You do not need to have the source files on the target.

    Start WinDbgRm.

    WinDbgRm starts minimized as an icon. Its default is to communicate with WinDbg across the network, using the named pipe  windbg . If you want to change how the host and target communicate, double-click on the WinDbgRm icon and select the Transport DLL command from the Options menu. Choose the appropriate transport layer in the Known Transport Layers list box.

  3.  On the host computer:

    Start WinDbg from the command prompt:

start windbg yourprog.exe

 

    Use the Debugger DLLs command from the Options menu to change the transport layer to match the one used by WinDbgRm on the target. If you are using named pipes, use the Change button to modify the transport layer parameters so that the first parameter is the name of the target computer.

    Select the Execution Model and Expression Evaluator to reflect the target computer.

    Use the User DLLs command from the Options menu to specify the symbol search path to your program s symbols; use the Debug command from the Options menu to specify the source search path to your source files.

    Select Go from the Run menu.

 

If you can start your program on the target before attaching the debugger to it, then you can change step 3 as follows:

On the host computer:

    Start WinDbg.

    Use the Debugger DLLs command from the Options menu to change the transport layer to match the one used by WinDbgRm on the target. If you are using named pipes, use the Change button to modify the transport layer parameters so that the first parameter is the name of the target computer.

    Select the Execution Model and Expression Evaluator to reflect the target computer.

    Use the User DLLs command from the Options menu to specify the symbol search path to your program s symbols; use the Debug command from the Options menu to specify the source search path to your source files.

    Select the Attach command from the Run menu.

    Select your program from the task list that the Attach command displays.

 

To connect to a computer with an IPC password, use the NET USE command to manually connect to the remote IPC$ share.

Use the .disconnect command to disconnect the host from the target. Use the .attach command to reestablish the connection. Another computer can run WinDbg and use .attach to connect to the target and debug your program. If you are still connected and another computer tries to connect to the target, you will receive a popup notifying you of that fact. You have 20 seconds to cancel the pop-up, then you will be disconnected and the other computer will be connected as the host of the remote debugging session.

If problems occur, check connections and make sure that WinDbg and WinDbgRm are using the same communications methods. If your system has trouble maintaining the communications link between the host and target computers, when communicating through a serial port, reduce the transmission baud rate.